package eu.runelord.programmers.java.gridlayouttutorial;

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

class GridLayoutExample extends JFrame {

	private static final long serialVersionUID = 5542988826027886015L;

	public static void main(String[] args) {
		GridLayoutExample gridLayoutExample = new GridLayoutExample();
		gridLayoutExample.setVisible(true);
	}

	public GridLayoutExample() {
		init();
	}

	private void init() {
		GridLayout gridLayout = new GridLayout(3, 2);
		JButton b1 = new JButton("Button 1"), b2 = new JButton("Button 2"), b3 = new JButton(
				"Button 3");
		JTextField textField = new JTextField("pole tekstowe");
		JLabel label = new JLabel("Tekst");
		
		setLayout(gridLayout);
		setTitle("Przykład BorderLayout");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		add(b1);
		add(b2);
		add(b3);
		add(textField);
		add(label);
		pack();
	}
}

// bardzo długi tekst, który napewno jest dłuższy niż standardowy przycisk
